<template>
  <div>
    <Header title="今日购物车" backgroundColor="pink" color="write"></Header>

    <div class="main">
      <Goods :goodObj="obj" v-for="obj in list" :key="obj.id"></Goods>
    </div>

    <Footer :alL="list"></Footer>
  </div>
</template>

<script>
import Header from "./components/Header";
import Goods from "./components/Goods";
import Footer from "./components/Footer";
export default {
  components: {
    Header,
    Goods,
    Footer,
  },
  data() {
    return {
      list: [],
    };
  },
  created() {
    this.$axios({
      url: "https://www.escook.cn/api/cart",
      method: "GET",
    }).then((res) => {
      console.log(res.data.list);
      return (this.list = res.data.list);
    });
  },
};
</script>

<style scoped>
.main {
  padding: 45px 0 50px 0;
}
</style>